package com.googlecode.imanager.core.base.style;

import com.googlecode.imanager.client.bridge.style.IOpacity;
import com.googlecode.imanager.client.style.Opacity;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public class ComputedOpacity implements IOpacity, ComputedAttribute<IOpacity> {

    protected float value = 1;

    @Override
    public void mergeWith(IOpacity o) {
        if (o != null){
            value = o.getValue();
        }
    }

    @Override
    public void copyFrom(IOpacity o) {
        if (o != null){
            value = o.getValue();
        } else {
            value = Opacity.EMPTY_OPACITY.getValue();
        }
    }

    public float getValue() {
        return value;
    }

    public void setValue(float value) {
        this.value = value;
    }
    
}
